package com.tianxinweb.enums;

/**
 * 错误状态码与信息枚举类
 * Created by cboy on 2018/1/23.
 */
public enum ResultEnum {
    UNKNONW_ERROR(-1,"未知错误！"),
    NO_LOGGED_IN(-2,"未登录"),
    PERMISSION_DENIED(-3,"没有访问权限"),
    REQUEST_ERROR(-4,"请求方式错误"),
    MISSING_PARAMETER_ERROR(-5,"缺少参数错误"),
    SUCCESS(200,"成功！"),
    FAILE(201,"失败！"),
    PARAMETER_FORMAT_ERROR(202,"参数不正确!"),
    LOGIN_PWD_OR_ACCOUNT_ERROR(203,"密码或账号不正确！"),
    ACCOUNT_LOCKED_UP(204,"账号已被锁定，请联系管理员更改状态！"),
    COMFIRM_PWD_ERROR(206,"确认密码不正确" ),
    ADMIN_NAME_USED(207,"管理员名称已被使用" ),
    ADMIN_WORKINGPWD_ERROR(208,"工作密码错误"),
    ROLE_NAME_USED(209,"角色名称已被使用" ),
    ROLE_PRIVILEGE_EMPTY_ERROR(210,"角色权限不能为空" ),
    PRIVILEGE_PARENT_ID_ERROR(211,"权限不存在" ),
    PARENT_PRIVILEGE_ERROR(212,"父权限不能为本身和自己的子权限" ),
    PARENT_PRIVILEGE_TYPE_ERROR(213,"本身为菜单时父级也必须为菜单" ),
    FILE_NOT_EXISTS(214,"文件或图片不存在" ),
    FILE_SIZE_ERROR(215,"文件或图片不能超过2M" ),
    FILE_FORMAT_ERROR(216,"文件或图片格式不正确" ),
    CHECKCODE_EXPIRED(217,"验证码已过期" ),
    CHECKCODE_ERROR(218,"验证码错误" ),
    THE_PHONE_IS_USED(219,"该手机号码已被注册" ),
    OLDPWD_ERROR(220,"旧密码错误" ),
    USER_NOT_EXIST(221,"用户不存在" ),
    BUSINESS_LIMIT_CONTROL(222,"发送次数超过平台次数限制,支持1条/分钟，5条/小时，累计10条/天" ),
    RELATION_ERROR(223,"只能删除最低级用户关系" );

    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
